/**
 * 
 */
package br.com.ctm.advogadope.negocio.api;

import java.util.Date;
import java.util.List;

import javax.ejb.Local;
import javax.persistence.PersistenceException;

import br.com.ctm.advogadope.dao.api.ProcessoDao;
import br.com.ctm.advogadope.model.Advogado;
import br.com.ctm.advogadope.model.Processo;
import br.com.ctm.advogadope.model.Tribunal.TipoJuizo;
import br.com.framework.negocio.api.BaseNegocio;
import br.com.framework.negocio.exception.NegocioException;
import br.jus.cnj.intercomunicacao.beans.ProcessoJudicial;

/**
 * @author Cleber
 *
 */
@Local
public interface ProcessoNegocio extends BaseNegocio<Processo, ProcessoDao> {

	/**
	 * @param processoId
	 * @param movimentos
	 * @param dataReferencia
	 * @return
	 * @throws NegocioException
	 */
	public ProcessoJudicial buscarProcessoJudicial(Long processoId, boolean movimentos, Date dataReferencia) throws NegocioException;
	
	/**
	 * @param processo
	 * @param movimentos
	 * @param dataReferencia
	 * @return
	 * @throws NegocioException
	 */
	public ProcessoJudicial buscarProcessoJudicial(Processo processo, boolean movimentos, Date dataReferencia) throws NegocioException;
	
	/**
	 * Consultar Processo.
	 * 
	 * @param npu
	 * @param idTribunal
	 * @param tipoJuizo
	 * @return
	 * @throws NegocioException
	 */
	public Processo consultarProcesso(String npu, Long idTribunal, TipoJuizo tipoJuizo) throws NegocioException;
	
	/**
	 * @param npu
	 * @return
	 * @throws NegocioException
	 */
	public Processo findByNPU(String npu) throws NegocioException;
	
	/**
	 * @param advogado
	 * @param firstResult
	 * @param maxResults
	 * @param onlyActive
	 * @return
	 * @throws PersistenceException
	 */
	public List<Processo> findByAdvogado(Advogado advogado, int firstResult, int maxResults, boolean onlyActive) throws PersistenceException;
	
	/**
	 * @param filtro
	 * @param advogado
	 * @param firstResult
	 * @param maxResults
	 * @param onlyActive
	 * @return
	 * @throws PersistenceException
	 */
	public List<Processo> findByFiltroEAdvogado(Processo filtro, Advogado advogado, int firstResult,
			int maxResults, boolean onlyActive) throws PersistenceException;
	
	/**
	 * @param intervalo
	 * @param firstResult
	 * @param maxResults
	 * @param onlyActive
	 * @return
	 * @throws PersistenceException
	 */
	public List<Processo> findByDtAtualizacaoMaiorQueIntervalo(int intervalo, int firstResult,
			int maxResults, boolean onlyActive) throws PersistenceException;
	
	
}
